<?php
$title = array('id' => 'event-title', 'name' => 'event_title', 'size' => 50, 'maxlength' => 255);
$content = array('id' => 'event-content', 'name' => 'event_content', 'rows' => 10, 'cols' => 60);
$submit = array('class' => 'btn btn-success', 'name' => 'event_submit', 'value' => lang('event_submit'));

if(isset($event)) {
    $title['value'] = $event['title'];
    $content['value'] = $event['content'];
} else {
    $title['value'] = set_value($title['name']);
    $content['value'] = set_value($content['name']);
}

echo form_open('events/index/admin');
?>

<div class="page-header">
    <h3><?php echo lang(isset($event) ? 'event_edit' : 'event_create'); ?></h3>
</div>

<p>
    <?php if(isset($event)) echo form_hidden('event_id', $event['id']); ?>
    <span class="form-inline"><?php echo lang($title['name'], $title['id']).form_input($title); ?></span>
    <span class="form-inline"><?php echo lang($content['name'], $content['id']).form_textarea($content); ?></span>
</p>

<p class="form-actions"><?php echo form_submit($submit); ?></p>

<?php echo form_close(); ?>